Expand description
Common traits and helper macros for binary encoding and decoding.
This crate provides common Encode
and Decode
traits for describing binary encode/decode-able objects, as well as #[derive(Encode)]
and #[derive(Decode)]
macros to reduce boilerplate when propagating these and little-endian implementations for primitive types.
For more implementation see the module-level documentation.
This is intended to provide a reusable base for implementing binary encodable objects to match a particular protocol or specification (and mitigate embedded pub trait (Encode|Decode) {..}
bankruptcy)
If you don’t need to control the encoded layout directly you might like to look at serde, with postcard for efficient binary encoding between rust components. If you’re creating a new protocol for cross-language use you may wish to consider creating a specification using protocol buffers and prost.
Modules
Enums
Traits
Derive Macros
#[derive(Decode)]
support.#[derive(DecodeOwned)]
support.#[derive(Encode)]
support.